import math

# 向上下取整
b = math.floor(5.1)
print(b)

# 向上取整
c = math.ceil(5.1)
print(c)

# 四舍五入
d = round(4.5)
print(d)

# 将小数转换为比值 (1, 4)
t = float.as_integer_ratio(0.25)
print(t)


t=float.as_integer_ratio(0.125)
print(t)